package com.dingli.admin.service.impl;

import com.dingli.admin.service.IAreaService;
import com.dingli.framework.entity.Area;
import com.dingli.framework.mapper.AreaMapper;
import com.dingli.framework.util.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IAreaServiceImpl implements IAreaService {
    @Autowired
    private AreaMapper areaMapper;

    @Override
    public Response<List<Area>> allArea() {
        return new Response<>(200, "success", areaMapper.allArea());
    }

    @Override
    public Response<Area> selectById(Long areaId) {
        return new Response<>(200, "success", areaMapper.selectById(areaId));
    }

    @Override
    public Response<List<Area>> selectByParentId(Long parentId) {
        return new Response<>(200, "success", areaMapper.selectByParentId(parentId));
    }
}
